// 生成一个a-z的字符串
/* let str = "";
for (let i = "a".charCodeAt(0); i <= "z".charCodeAt(0); i++) {
  str += String.fromCharCode(i);
}
console.log(str);
 */

// rgb转换为HEX
/* const rgb = "rgb(253, 183, 25)";
const parts = rgb
  .replace("rgb", "")
  .replace("(", "")
  .replace(")", "")
  .split(",");
const r = parseInt(parts[0]).toString(16);
const g = parseInt(parts[1]).toString(16);
const b = parseInt(parts[2]).toString(16);
const ret = "#" + r + g + b;
console.log(ret); */

// name转换成驼峰命名
const name = "has own property";
const parts = name.split(" ");
for (let i = 1; i < parts.length; i++) {
  parts[i] = parts[i][0].toUpperCase() + parts[i].slice(1);
}
console.log(parts.join(""));
